# 查看alias
alias a="cat ~/sh/alias.sh"
# 启动项目
alias start='npm run start'
# 开发模式
alias dev='npm run dev'
# 构建项目
alias build='npm run build'
# pnpm 命令
alias p=pnpm
# npm run 命令
alias nr='npm run'
# git 命令
alias g=git
alias gll='git pull'
# 获取本机 IP 地址
alias ip='ifconfig | grep "inet " | grep -v 127.0.0.1 | cut -d\  -f2'
# 升级主版本号
alias nx='npm version major'
# 升级次版本号
alias ny='npm version minor'
# 升级修订版本号
alias nz='npm version patch'
# 清屏
alias c='clear'
# 打开vim编辑器
alias vi='vim'
# 重载.zshrc文件
alias szsh='source ~/.zshrc'
# 运行demo.sh脚本
alias demo=". ~/sh/demo.sh"
# 运行runPro.sh脚本
alias dockerNode="bash ~/sh/docker/runPro.sh"
# 获取当前分支名称
alias gb="git rev-parse --abbrev-ref HEAD"
# 执行git clone命令，克隆指定仓库最后一个提交
alias gcl1="git clone --recurse-submodules --depth 1 $@"
# 执行orgin github提交操作,提交最后一个tag
alias gpush="bash ~/sh/gitPush.sh"
# 打包指定文件夹
alias tarFolder="bash ~/sh/tarFolder.sh $@"
# 传入commitMessage提交代码并推送
function gcamp() {
  git commit --all --message "${1:-upSome}" && git push
}
alias nv='node -v'
# 更新zsh
alias upsh="cd ~/sh && git pull && szsh"
# dns
alias dns="echo $(grep -m 1 '^nameserver' /etc/resolv.conf | awk '{print $2}')"
# proxy
alias proxy1="export ALL_PROXY=http://127.0.0.1:7777"
function proxy() {
  export http_proxy=http://127.0.0.1:7777
  export https_proxy=http://127.0.0.1:7777
  export ALL_PROXY=http://127.0.0.1:7777
  export no_proxy="localhost,127.0.0.1,.local,.internal"
  echo "✅ 代理已开启: http://127.0.0.1:7777"
}
# unProxy
unProxy() {
  unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY ALL_PROXY
  echo "🔌 代理已关闭"
}
# wslProxy
alias wslProxy="export ALL_PROXY=$(grep -m 1 '^nameserver' /etc/resolv.conf | awk '{print $2}'):7777"
# git crlf为仓库添加crlf兼容win/mac处理
alias glf="echo '* text=auto eol=lf'>./.gitattributes"
alias temperature=". ~/sh/temperature.sh"
# ubuntu
alias uTheme="gnome-tweaks"
# 挂起
alias usleep="systemctl suspend"
